package org.aplombh.java.interview.newcoder;

public class NC68_跳台阶 {
    /**
     * 代码中的类名、方法名、参数名已经指定，请勿修改，直接返回方法规定的值即可
     *
     * @param number int整型
     * @return int整型
     */
    public int jumpFloor(int number) {
        // write code here

        int[] f = new int[41];
        f[0] = f[1] = 1;

        return jump(f, number);
    }

    private int jump(int[] f, int number) {
        if (f[number] == 0)
            f[number] = jump(f, number - 1) + jump(f, number - 2);
        return f[number];
    }
}
